home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kurlpixmapprovider.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  1.9 KB  |  60 lines

  1. /* This file is part of the KDE libraries
  2.  
  3.    Copyright (c) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
  4.  
  5.    This library is free software; you can redistribute it and/or
  6.    modify it under the terms of the GNU Library General Public
  7.    License (LGPL) as published by the Free Software Foundation; either
  8.    version 2 of the License, or (at your option) any later version.
  9.  
  10.    This library is distributed in the hope that it will be useful,
  11.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the GNU
  13.    Library General Public License for more details.
  14.  
  15.    You should have received a copy of the GNU Library General Public License
  16.    along with this library; see the file COPYING.LIB.  If not, write to
  17.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.    Boston, MA 02110-1301, USA.
  19. */
  20.  
  21. #ifndef KURLPIXMAPPROVIDER_H
  22. #define KURLPIXMAPPROVIDER_H
  23.  
  24. #include <kpixmapprovider.h>
  25. #include <kmimetype.h>
  26.  
  27. /**
  28.  * Implementation of KPixmapProvider.
  29.  *
  30.  * Uses KMimeType::pixmapForURL() to resolve icons.
  31.  *
  32.  * Instatiate this class and supply it to the desired class, e.g.
  33.  * \code
  34.  * KHistoryCombo *combo = new KHistoryCombo( this );
  35.  * combo->setPixmapProvider( new KURLPixmapProvider );
  36.  * [...]
  37.  * \endcode
  38.  *
  39.  * @short Resolves pixmaps for URLs
  40.  * @author Carsten Pfeiffer <pfeiffer@kde.org>
  41.  */
  42. class KIO_EXPORT KURLPixmapProvider : public KPixmapProvider
  43. {
  44. public:
  45.     /**
  46.      * Returns a pixmap for @p url with size @p size.
  47.      * Uses KMimeType::pixmapForURL().
  48.      * @param url the URL to fetch a pixmap for
  49.      * @param size the size of the pixmap in pixels, or 0 for default.
  50.      * @return the resulting pixmap
  51.      * @see KIcon::StdSizes
  52.      */
  53.     virtual QPixmap pixmapFor( const QString& url, int size = 0 );
  54. protected:
  55.     virtual void virtual_hook( int id, void* data );
  56. };
  57.  
  58.  
  59. #endif // KURLPIXMAPPROVIDER_H
  60.